GBML manual / Drawing

ANCHOR_BOTTOM_LEFT

Names the bottom-left corner of the screen, for draw_text_anchored, draw_text_warped_anchored, draw_text_3d_anchored, draw_rect_anchored and draw_rect_fill_anchored - the position you give them is measured from this spot.

Syntax

ANCHOR_BOTTOM_LEFT: constant

Description

Names the bottom-left corner of the screen. Give it to draw_text_anchored, draw_text_warped_anchored, draw_text_3d_anchored, draw_rect_anchored or draw_rect_fill_anchored as their first argument, and the position you give after it is measured from this spot. The screen anchors page explains the idea in full.

Example

draw_rect_fill_anchored(ANCHOR_BOTTOM_LEFT, 4, -10, 40, 6, COLOR_RED);

A red bar 40 pixels wide and 6 tall, 4 pixels in from the left edge and 4 up from the bottom - the kind of thing a health bar is made from. A rectangle's (x, y) is its top-left corner, so the bar's left edge is at 4 and its bottom edge at -10 + 6 = -4.

On the GBA

The screen is 240 pixels wide and 160 tall, and a plain draw call in a Draw GUI event counts from its top-left pixel, so this spot is the point (0, 160) in their numbers. ANCHOR_BOTTOM_LEFT with an offset of (x, y) lands on exactly the same pixel as the plain call in a Draw GUI event (x, y + 160) - the same spot, written by what it means instead of by the size of the screen.

See also: Screen anchorsdraw_text_anchoreddraw_rect_fill_anchored